package routers

import (
	"backend/controllers"
	"backend/services"
	"backend/utils"

	"github.com/gin-gonic/gin"
)

func RegisterRoleRoutes(r *gin.RouterGroup) {
	service := services.NewRoleServices(utils.DB)
	control := controllers.NewRoleControl(service)
	r.POST("/role/create", control.Create)
	r.PUT("/role/:id/update", control.Update)
	r.DELETE("/role/:id/delete", control.Delete)
	r.GET("/role/list", control.GetList)
	r.POST("/role/permission", control.SetRolePermission)
	r.GET("/role/:id/permission", control.GetRolePermission)
}
